Get Ref

image186.gif

GetRef is one of three Reference operators within thinkingParticles. GetRef is used to retrieve the reference particles. Before it can be used a SetRef operator must be used to create references between two or more particles.

References in thinkingParticles are somewhat different than the 3dsmax reference option when creating cloned objects. In thinkingParticles, the reference is a relationship between two particles, where one particle is defined as the To particle in the relationship, and the other particle is the From particle. There is no hierarchical implication, only a directional To/From relationship. It is often easiest to imagine a hierarchical relationship and consider the From particle as the parent and the To particle as the child.

Remember that the reference is directional and that it is created From one particle To another particle. When using SetRef you define one particle to be the From particle and the other particle as the To particle. When using GetRef you are asking either the From or the To particle "who is your reference?" and you must specify if you are requesting the To or the From reference particle.

Example 1:
we use SetRef to create a reference between particle ID 4 and 5 PID 4 and PID 5. With SetRef we pipe PID 4 into the From input and PID 5 into the To input. This creates a reference relationship between PID 4 and 5 where PID 4 is the From particle and PID 5 is the To particle. Then in another dynamic set we use GetRef and use PID 4 as the input. This means we are inquiring about To and From relationships for PID 4. In the GetRef operator we specify From because we want to find out relationships where PID 4 is the From particle. GetRef will then output PID 5 because it has a relationship with PID 4 where PID 4 is the From particle. If we set GetRef to To it will not return anything in this case because there are no relationships where PID 4 is the To particle in the relationship.

Important
Keep in mind that particles can have multiple To/From partners. If using GetRef and the result contains multiple PIDs then the output connection will iterate through the results.

Operator Inputs

ON - (Bool) This input data stream determines whether the operator is considered 'on' or 'off.' You can connect other operators to this input channel such as a Bool Helper to activate/deactivate the whole operator.

Time
- (Time) This input data stream is used to define the local time for the operator when the user wants to override the default system time.

Particle
- (Particle) lets you set the particle from which you wish to get a reference.

Type
- (Integer) sets the reference type to one of the following methods: 0= From Me; 1= To Me; 2=From & to Me

Operator Outputs

Ref. Particle - outputs the referenced particles (dependent upon the reference Type chosen)

Number Refs.
- outputs the total number of references depending on the setting of From Me, To ME, or both.

Rollout Menu 

image185.gif

From Me
- check this option to get the referenced particle that is connected to the one at the Particle input

To Me
- when checked, the particle is output that is holding a reference to the one connected at the Particle input

From & To Me
- outputs the particles that are connected to this Particle and it outputs those particles as well as particles to which this Particle is connected.